#ifndef MUSIC_H
#define MUSIC_H

#include <QWidget>

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QStandardItemModel>
#include <QList>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QPainter>
#include <QPixmap>
#include <QLabel>

namespace Ui {
class Music;
}

class Music : public QWidget
{
    Q_OBJECT

public:
    explicit Music(QWidget *parent = nullptr);
    ~Music();

public slots:
    void setBackgroundImage(QString path);
    void onResized();
private slots:
     void parseJson(QByteArray byteArray);
      void parseJson_2(QByteArray byteArray);

    void replyFinished(QNetworkReply *reply);
    void durationChangedSlot(qint64 duration);
    void positionChangedSlot(qint64 position);
    void on_pushButton_clicked();
    void on_tableView_doubleClicked(const QModelIndex &index);
    void on_horizontalSlider_sliderReleased();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_comboBox_activated(int index);

    void on_pushButton_5_clicked();

private:
    QStandardItem *itemWithImage;
    QPixmap backgroundImage;

     QJsonArray songsArry;

    QMediaPlayer *player;
    QMediaPlaylist *playlist;
    QList<int> musicIDList;
    QStandardItemModel * pModel;
    QNetworkAccessManager *manager;
    Ui::Music *ui;
};


#endif // MUSIC_H
